package cn.monkey.chat.server.proto.json;

import cn.monkey.chat.server.proto.Message;
import cn.monkey.chat.server.proto.User;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class JsonMessage implements Message {
    private JsonUser from;
    private List<JsonUser> to;
    private JsonContent content;

    public List<User> getTo() {
        return this.to == null || this.to.isEmpty() ? null : new ArrayList<>(this.to);
    }
}
